<!DOCTYPE HTML>
<html lang="zh" xmlns:th="http://www.thymeleaf.org" xmlns:shiro="http://www.pollix.at/thymeleaf/shiro">
<meta charset="utf-8">
<head th:include="include :: header"></head>
<body class="gray-bg">

<div class="container-div">
    <div class="row">
        <div class="col-sm-12 search-collapse">
            <form id="formId">
                <div class="select-list">
                    <ul>

                        <li>
                            内部单号：<input type="text" name="innerOrderId"/>
                        </li>

                        <li>
                            外部单号：<input type="text" name="outOrderId"/>
                        </li>

                        <li>
                            回调次数：<input type="text" name="num"/>
                        </li>

                        <li>
                            请求地址：<input type="text" name="url"/>
                        </li>

                        <li>
                            响应代码：<input type="text" name="resCode"/>
                        </li>
                        <li>
                            <a class="btn btn-primary btn-rounded btn-sm" onclick="$.table.search()"><i
                                    class="fa fa-search"></i>&nbsp;搜索</a>
                            <a class="btn btn-warning btn-rounded btn-sm" onclick="$.form.reset()"><i
                                    class="fa fa-refresh"></i>&nbsp;重置</a>
                        </li>
                    </ul>
                </div>
            </form>
        </div>

        <div class="btn-group-sm hidden-xs" id="toolbar" role="group">
            <a class="btn btn-primary btn-edit disabled" onclick="$.operate.detail()"
               shiro:hasPermission="aerchant_call_log_detail">
                <i class="fa fa-edit"></i> 详情
            </a>
            <a class="btn btn-danger btn-del btn-del disabled" onclick="$.operate.removeAll()"
               shiro:hasPermission="aerchant_call_log_remove">
                <i class="fa fa-remove"></i> 删除
            </a>
            <a class="btn btn-warning" onclick="$.table.exportExcel()" shiro:hasPermission="aerchant_call_log_export">
                <i class="fa fa-download"></i> 导出
            </a>
        </div>
        <div class="col-sm-12 select-table table-striped">
            <table id="bootstrap-table" data-mobile-responsive="true"></table>
        </div>
    </div>
</div>
<div th:include="include :: footer"></div>
<script th:inline="javascript">
    var editFlag = [[${@permission.hasPermi('aerchant_call_log_edit')}]];
    var removeFlag = [[${@permission.hasPermi('aerchant_call_log_remove')}]];
    var prefix = ctx + "aerchant/call_log";
    var logStateDir = [[${@dict.getType('pay_call_log_state')}]];

    $(function () {
        var options = {
            url: prefix + "/list",
            detailUrl: prefix + "/detail/{id}",
            removeUrl: prefix + "/remove",
            exportUrl: prefix + "/export",
            modalName: "回调日志",
            search: false,
            showExport: true,
            columns: [{
                checkbox: true
            },
                {
                    field: 'id',
                    title: 'ID',
                    visible: true
                },
                {
                    field: 'innerOrderId',
                    title: '内部单号',
                    sortable: true
                },
                {
                    field: 'outOrderId',
                    title: '外部单号',
                    sortable: true
                },
                {
                    field: 'url',
                    title: '地址',
                    sortable: true
                },
                {
                    field: 'state',
                    title: '状态',
                    sortable: true,
                    formatter: function (value, row, index) {
                        return $.table.selectDictLabel(logStateDir, value);
                    }
                },
                {
                    field: 'resCode',
                    title: '状态码',
                    sortable: true
                },

                {
                    field: 'num',
                    title: '回调次数',
                    sortable: false
                },
                {
                    field: 'createTime',
                    title: '回调时间',
                    sortable: false
                }]
        };
        $.table.init(options);
    });
</script>
</body>
</html>